# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-libvmi
_pkgname=libvmi
pkgver=186.c21af83
pkgrel=3
pkgdesc='Python interface to LibVMI.'
arch=('x86_64' 'aarch64')
url='https://github.com/libvmi/python'
license=('GPL3')
depends=('python' 'python-pkgconfig' 'python-cffi' 'python-future' 'libvmi')
makedepends=('git' 'python-setuptools' 'python-wheel')
source=("$pkgname::git+https://github.com/$_pkgname/python.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|"pytest-runner"||g' setup.py
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

